package com.framework.service;

import cn.dev33.satoken.util.SaResult;
import com.framework.entity.ChunkFile;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @Description: 切片文件服务接口
 * @Author: JamesYao
 * @DateTime: 2024/1/17 0:28
 */
public interface ChunkFileService {
    List<ChunkFile> getChunks();
    SaResult saveChunk(ChunkFile chunkFile);
    SaResult uploadChunk(MultipartFile file, ChunkFile chunkFile)
            throws NoSuchAlgorithmException, IOException, ExecutionException, InterruptedException;
    SaResult backUploadChunk(MultipartFile file, ChunkFile chunkFile, String sumHash)
            throws NoSuchAlgorithmException, IOException, ExecutionException, InterruptedException;
}
